Skip to content

C++: Round result of >> in SimpleRangeAnalysis#3445

Merged
rdmarsh2 merged 3 commits into
github:masterfrom
geoffw0:rangerounding
May 11, 2020
Merged

C++: Round result of >> in SimpleRangeAnalysis#3445
rdmarsh2 merged 3 commits into
github:masterfrom
geoffw0:rangerounding

Conversation

@geoffw0

@geoffw0 geoffw0 commented May 11, 2020

Copy link
Copy Markdown
Contributor

Fix for #3277 (see https://github.com/github/codeql-c-analysis-team/issues/59).

I don't think & needs any changes as the current implementation sets bounds to either 0 or an existing bound with no calculation applied - so it should already be a suitably round number.

For >> we now round down.

There are some edge cases for int64 types that we don't handle well (because QL floor() fails on large numbers!) so such cases are simply excluded from the analysis.

@geoffw0 geoffw0 added the C++ label May 11, 2020
@geoffw0 geoffw0 requested a review from a team as a code owner May 11, 2020 18:05

@rdmarsh2 rdmarsh2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rdmarsh2 rdmarsh2 merged commit 0909774 into github:master May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants